/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.memento;

/**
 * 备忘录模式
 * @author caicongyang1
 * @version id: MementoClient, v 0.1 17/5/17 下午9:13 caicongyang1 Exp $$
 */
public class MementoClientTest {
    public static void main(String[] args) {
        Originator originator = new Originator();
        originator.setState("on");
        originator.show();

        Manager manager = new Manager();
        manager.setMemento(originator.createMemento());

        originator.setState("off");
        originator.show();

        originator.setMemento(manager.getMemento());
        originator.show();

    }
}
